package com.house.keeper.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.house.keeper.constant.ConstantConfig;
import com.house.keeper.entity.Deptment;
import com.house.keeper.mapper.DeptmentMapper;
import com.house.keeper.service.DeptmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zjj
 * @date 2022-05-13
 */
@Service
public class DeptmentServiceImpl implements DeptmentService {
    @Autowired
    private DeptmentMapper deptmentMapper;
    /**
     * 查询所有部门
     *
     * @return
     */
    @Override
    public List<Deptment> selectAll() {
        QueryWrapper<Deptment> wrapper = new QueryWrapper<>();
        wrapper.eq("dept_status", ConstantConfig.STATUS_YES);
        return deptmentMapper.selectList(wrapper);
    }
}
